from pattern.circuit import Control

class entry(Control):
    
    def incoming(self, event):
        path, = event.data
        print path
        while path and path[0] == '/': path = path[1:]
        if path == "": path = "index.html"
        bridge = self.acquireInterface(event, path)
        if bridge is not None:
            bridge.push(path)
        else:
            bridge = self.acquireInterface(event, "default")
            if bridge is not None:
                bridge.push(path)
